package com.h.web.inteceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

public class TestInterceptor extends HandlerInterceptorAdapter {

	@Override
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {
		
		//獲取請求方法
		String method = request.getMethod();
		System.out.println("@@@@@@@@@@@@@@method:" + method);
		
		String path = request.getServletPath();
		String url = request.getRequestURI();
		
		String param = request.getParameter(url);
		System.out.println("@@@@@@@@@@@@@@ServletPath:" + path);
		System.out.println("@@@@@@@@@@@@@@RequestURI:" + url);
		System.out.println("@@@@@@@@@@@@@@param:" + param);
		return true;
	}
}
